﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XiAnAirport.BUS;
using XiAnAirport.DAL;
using XiAnAirport.Models;

namespace XiAnAirport
{
    public class DataPushJob : IJob
    {
        public async Task Execute(IJobExecutionContext context)
        {
            List<LiftStateALL> list = ElevatorStateBUS.state_list;
            foreach (var item in list)
            {
                DeviceDataMonitor deviceDataMonitor = new DeviceDataMonitor();
                deviceDataMonitor.systemCode = "PCS";
                deviceDataMonitor.assetCode = "PCS" + "-" + item.ElevatorNO;
                deviceDataMonitor.metricsTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                DeviceData deviceData = new DeviceData();
                deviceData.runStatus = item.Elevator_moving_status;
                deviceDataMonitor.data = deviceData;

            }
        }
    }
}
